package com.ngc.mall.controller;

import com.ngc.mall.common.configure.response.ResponseResult;
import com.ngc.mall.service.IBannerService;
import com.ngc.mall.vo.BannerVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/banner")
public class BannerController {
    @Resource
    private IBannerService iBannerService;

    @GetMapping("/by/keywords")
    @ApiOperation("根据keywords获取banner")
    public ResponseResult<List<BannerVO>> getBannerByKeyword() {
//        @RequestBody List<String> keywords
        List<String> keywords = new ArrayList<>();
        keywords.add("b-1");
        keywords.add("b-2");
        return ResponseResult.success(iBannerService.getBannerByKeyword(keywords));
    }


}
